<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">
</head>
<style>
    #button{
        width: 150px;
        height: 68px;
        background: red;
        margin: 0 auto;
        text-align: center;
        line-height: 68px;
        border-radius: 20px;
    }
    #allprice{
        width: 150px;
        height: 100px;
        text-align: center;
        line-height: 100px;
        margin: 0 auto;
    }
    .wai{

    }
    .zhong{
        width: 216px;
        margin: 0 auto;
    }
</style>
<body>
<div class="wai">
    <div class="zhong">
        价格:
        <input type="text" id="price" type="number">
    </div>
    <div class="zhong">
        数量:
        <input type="text" id="num" type="number">
    </div>
    <div class="zhong">
        利润:
        <input type="text" id="need" type="number">
    </div>
</div>


<div id="allprice"></div>
<div id='button' onclick="button()">开始计算</div>
</body>
<script src="http://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script>
    wx.ready(function () {   //需在用户可能点击分享按钮前就先调用
        wx.updateAppMessageShareData({
            title: '爱愈美丽', // 分享标题
            desc: '爱愈美丽1', // 分享描述
            link: 'http://www.baidu.com', // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
            imgUrl: './img.png', // 分享图标
            success: function () {

            }
        })
    });
    wx.ready(function () {      //需在用户可能点击分享按钮前就先调用
        wx.updateTimelineShareData({
            title: '爱愈美丽', // 分享标题
            link: 'http://www.baidu.com', // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
            imgUrl: './img.png', // 分享图标
            success: function () {
                // 设置成功
            }
        })
    });
    function button(){
        var price = document.getElementById("price");
        var num = document.getElementById("num");
        var need = document.getElementById("need");
        var allprice = document.getElementById("allprice");
        var can = need.value;
        var prices = (parseInt(price.value*num.value)+parseInt(can))/num.value;
        allprice.innerHTML = '卖出价格:'+prices;
    }

</script>
</html>